using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;


namespace YF.OneNote.DataTypes
{
  [GeneratedCode("xsd", "2.0.50727.1432")]
  [Serializable]
  
  [DesignerCategory("code")]
  [XmlType(Namespace = "http://schemas.microsoft.com/office/onenote/2007/onenote")]
  [XmlRoot(Namespace = "http://schemas.microsoft.com/office/onenote/2007/onenote", IsNullable = false,
    ElementName = "Notebooks")]
  public partial class Notes: NotesHierarchyNode
  {
    #region Fields



    private readonly NotesNodeCollection<Notebook> _notebooks = new NotesNodeCollection<Notebook>();
    private LiveSharedSections _liveSharedSections;

    private OpenSections _openSections;
    private UnfiledNotes _unfiledNotes;



    #endregion

    #region Properties/Indexers



    [XmlAttribute]
    public override string ID
    {
      get
      {
        return "";
      }
      set
      {
      }
    }


    [XmlAttribute("lastModifiedTime")]
    public override DateTime LastModifiedTime
    {
      get
      {
        DateTime lastModifiedTime = _notebooks[0].LastModifiedTime;

        foreach (Notebook notebook in _notebooks)
        {
          if (notebook.LastModifiedTime > lastModifiedTime)
            lastModifiedTime = notebook.LastModifiedTime;
        }

        return lastModifiedTime;
      }
      set
      {
      }
    }


    public LiveSharedSections LiveSharedSections
    {
      get
      {
        return _liveSharedSections;
      }
      set
      {
        _liveSharedSections = value;
      }
    }

    [XmlAttribute("name")]
    public override string Name
    {
      get
      {
        return "Notebooks";
      }
      set
      {
      }
    }


    [XmlElement("Notebook")]
    public NotesNodeCollection<Notebook> Notebooks
    {
      get
      {
        return _notebooks;
      }
    }


    public OpenSections OpenSections
    {
      get
      {
        return _openSections;
      }
      set
      {
        _openSections = value;
      }
    }


    public UnfiledNotes UnfiledNotes
    {
      get
      {
        return _unfiledNotes;
      }
      set
      {
        _unfiledNotes = value;
      }
    }



    #endregion

#if GENERATOR
    protected override bool UpdateSpecificContents(NotesHierarchyNode node, List<INotesChange> changes)
    {
      throw new NotImplementedException();
    }
#endif
  }
}